Links.php

<?php

$named_links = [
    'login' => ['Login', '/login/' ],
    'register' => ['Register', '/register/' ],
    'reset.password' => ['Reset Password', '/reset-password/' ],
    'dashboard' => ['Dashboard', '/dashboard/'],
    'logout' => ['Logout', '/logout/'],


    'help' => ['Help', '/info/help/'],
    'terms' => ['Terms & Conditions', '/info/terms/'],
    'security-logging' => ['Security Logging', '/info/security-logging/'],



    // for special usage 
    'request-password' => ['Reset Password', '/reset-password/' ],
];

//@TODO make the links view... not horrible

$urls = [];
foreach ($links as $link){
    if (!isset($named_links[$link])){
        throw new \Exception("Link '$link' is not configured.");
    }
    $name = $named_links[$link][0];
    $url = $named_links[$link][1];

    $url = $package->url($url);
    echo "<a href=\"$url\">$name</a>";
    if (count($links) > 1){
        echo "\n<br>\n";
    }
}